#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "schedulemodel.h"
#include "appconfig.h"
//#include "users.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
Q_OBJECT

public:
    //MainWindow(AppConfig& config, Users& users, QWidget *parent = 0);
    virtual ~MainWindow();

signals:
    void newSchedule(const Schedule& schedule);
    void addUser(const QString& name);

private:
    Ui::MainWindow *ui;
    ScheduleModel model_;
    AppConfig& conf;
    //Users& usrs;

    QMap<QString, Schedule> schedules_;

    void applyConfig();
    void loadUsers();

private slots:
    void on_addUser_clicked();
    void on_actionAddAllUsers_triggered();
    void on_actionOpen_triggered();
};

#endif // MAINWINDOW_H
